/*
 * @Author: gitee_com_zb
 * @Date: 2024-12-19 16:55:18
 * @LastEditors: gitee_com_zb
 * @LastEditTime: 2024-12-19 16:55:29
 * @FilePath: /algorithm/每日一题15.回文排列(easy).cpp
 * @Description: 题目链接 https://leetcode.cn/problems/palindrome-permutation-lcci
 */
class Solution {
public:
    bool canPermutePalindrome(string s) {
        // 奇数的个数只能有0或1个
        unordered_map<char, int> hash;
        for(auto &x : s) hash[x]++;
        int count = 0; 
        for(auto &kv : hash) 
            if(kv.second % 2 == 1) count++;
        return count <= 1 ? true : false;
    }
};